/*         */
console.log("----普通类----")
/*         */
class Test{
    // id:number
    // name:string
    // constructor(id:number,name:string) {
    //      this.id=id;
    //      this.name=name;
    // }
    constructor(public id:number, public name:string) {}
    speak():void{
        console.log("speak")
    }
}

let test = new Test(1,"嘻嘻嘻嘻");
console.log(test)

/*         */
console.log("----继承类----")
/*         */

class Test2 extends Test{
    constructor(public id:number, public name:string,public age:number) {
        super(id,name);
    }
}
console.log(new Test2(6,"嘻嘻hh",2))
// new Test2(2).speak()

/*         */
console.log("----接口类----")
/*         */

interface IntFace{
    input:string,
    output():string
}

class Test3 implements IntFace{
    input:string
    constructor(input:string) {
        this.input=input;
    }
    output(): string {
        console.log("output")
        return "output"
    }
}
new Test3("l").output()

/*         */
console.log("--------")
/*         */

let temp:Test3={
    input:"嘻嘻",
    output(): string {
        console.log("sc")
        return "output";
    }
}
temp.output()